home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
626-637
/
disk_635
/
powerlogo
/
utilities.doc
< prev
next >
Wrap
Text File
|
1992-05-06
|
8KB
|
241 lines
Utilities.doc
The LOGO program file "Utilities" when loaded, sets the amount of memory
LOGO holds in reserve, scrambles the random number generater, defines some
useful numerical constants, defines some utility procedures, and adds a
menu to the LOGO user interface. This is an example of how a file may be
used to extened LOGO. Similar files may be used to set up LOGO in any way
you like. You may run LOGO by clicking the "Utilities" icon, and all of
this will be loaded automatically.
The Utilities menu items:
Load Load a LOGO program file. Gets a file name from the
file requester.
Save Each of these saves contents of variables to a LOGO
program file. Gets the file name from the file requester.
Names Saves variables other than procedures.
Procs Saves variables that are procedures.
All Saves all variables.
Interrupt Interrupt a program. This is like the break key (CTRL G)
except you may continue by giving the command "cont".
Top Level Stop a program. This is similar to the break
key (CTRL G).
End Stop a program, and close all files, turtles, windows,
and screens.
Restart Close windows, screens, and files, erase all procedures,
and variables except those defined in this file
Quit Exit from LOGO.
Numerical constants:
If you need these, you won't have to type all these digits.
:e = 2.71828182845904523536
:pi = 3.14159265358979323846
Utility procedures:
all
Output list of all variable names.
allnames
Output list of names that contain something other than procedures.
allprocs
Output list of names that contain to procedures.
dr ( path pattern )
( path pattern-list )
path = An AmigaDOS directory name (word or list).
pattern = Word, a match pattern. Within a pattern the asterisk
(*) is a wild card and will match any group of zero
or more characters. A pattern that starts with a
tilde (~) will match anything that does not match the
rest of the pattern.
pattern-list = A list of patterns.
Print out contents of directory.
dra ( path pattern )
( path pattern-list )
path = An AmigaDOS directory name (word or list).
pattern = Word, a match pattern. Within a pattern the asterisk
(*) is a wild card and will match any group of zero
or more characters. A pattern that starts with a
tilde (~) will match anything that does not match the
rest of the pattern.
pattern-list = A list of patterns.
Print out contents of directory, and all sub directories.
edit name
name-list
name = Word, a variable name.
name-list = List of names.
Edit the contents of specified variables. This procedure works by
calling the "QED" text editor by Darren M. Greenwald. You may replace
"QED" with a call to the text editor of your choice.
end
Closes all files, windows, and screens, returns to toplevel.
filter list list
list = Any list.
Output list of all items in the second list except the items that are
in the first list.
ignore object ( object... )
Does nothing. Ignores the output of an operation.
initmenu
Set up the command window menus and demons.
interupt
A LOGO command shell that may be run from within other procedures.
link name
name = Word, a procedure name.
Output list of all procedures needed to run the named procedure.
lower object
object = Any word or list.
Output is just like input with all upper case letters converted to
lower case.
matchp pattern word
pattern-list word
pattern = Word, a match pattern. Within a pattern the asterisk
(*) is a wild card and will match any group of zero
or more characters. A pattern that starts with a
tilde (~) will match anything that does not match the
rest of the pattern.
pattern-list = A list of patterns.
word = Any word.
Output true if word fits pattern.
names
Output list of unburied names that contain something other than
procedures.
patfilter pattern list
pattern-list list
pattern = Word, a match pattern. Within a pattern the asterisk
(*) is a wild card and will match any group of zero
or more characters. A pattern that starts with a
tilde (~) will match anything that does not match the
rest of the pattern.
pattern-list = A list of patterns.
list = A list of words.
Output list of all words in the list that fit the pattern.
procs
Output list of unburied names that contain procedures.
prosave file-name name
file-name name-list
file-name = An AmigaDOS file name (word or list).
name = Word, a variable name.
name-list = List of names.
Save names, their bindings, and their protection (bury) status to
file with an icon.
restart
Close windows, screens, and files, erase all procedures, and variables
except those defined in this file
reverse object ( object )
object = Any word or list.
Reverse the order of the items in the object.
sdir ( path pattern )
( path pattern-list )
path = An AmigaDOS directory name (word or list).
pattern = Word, a match pattern. Within a pattern the asterisk
(*) is a wild card and will match any group of zero
or more characters. A pattern that starts with a
tilde (~) will match anything that does not match the
rest of the pattern.
pattern-list = A list of patterns.
Output sorted directory list.
sdira ( path pattern )
( path pattern-list )
path = An AmigaDOS directory name (word or list).
pattern = Word, a match pattern. Within a pattern the asterisk
(*) is a wild card and will match any group of zero
or more characters. A pattern that starts with a
tilde (~) will match anything that does not match the
rest of the pattern.
pattern-list = A list of patterns.
Output sorted directory list.
sort test list
test = A compare instruction (word or list).
list = Any list.
Sort list based on test.
turtle ( view-modes bit-planes )
view-modes = Number, viewport modes, sum of:
1 = hires
2 = lace
4 = extra half brite
bitplanes = Number of bit planes.
Prepare screen, window, and turtle for simple turtle graphics.
vpr object
object = Any word or list.
Print out contents of lists verticaly.
Examples:
The procedures described above include tools for sorting, filtering, and
displaying lists, saving, listing, and editing programs, listing
directories, ect. For example, to print a list of all variable names
currently in use, type this command:
vpr all
To list just the names of the procedures:
vpr allprocs
To list them alphabetecly:
vpr sort [ alphap ] allprocs
To save the contents of all variables currently in use:
prosave filerequest all
If you have writtin a procedure which includes calls to other procedures,
you may save it, and all other procedures needed to run it, using:
prosave "file-name link "procedure-name
To see which other procedures are needed to run one procedure:
vpr link "procedure-name
To print out the contents of a directory:
( dr "dir-name )
To print out just the names of files in a directory:
( dr "dir-name [ * ~*/ ] )
To print out just the names of subdirectories in a directory:
( dr "dir-name "*/ )